// common/api.js
const baseUrl = 'http://admin.bsmall.byesame.com';
 
function get(url, params = {}) {
  return new Promise((resolve, reject) => {
    uni.request({
      url: baseUrl + url,
      data: params,
      method: 'GET',
      success: resolve,
      fail: reject
    });
  });
}
 
function post(url, data = {}) {
  return new Promise((resolve, reject) => {
    uni.request({
      url: baseUrl + url,
      data: data,
      method: 'POST',
      success: resolve,
      fail: reject
    });
  });
}
 
export { get, post };